package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpContractsChangePageUtil extends SeleniumPageUtil {

	public final static By CTC_LINK_CHANGES_REQUESTS = By.id("btnTab1");
	public final static By CTC_LINK_QUOTES = By.id("btnTab2");
	public final static By CTC_LINK_RENEWALS = By.id("btnTab3");
	public static void enterChangesRequests(){
		//login
		SpHomePageUtil.enter();
		//enter contracts\change/renewals page
		SpHomePageUtil.enterContractsChange();
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{CTC_LINK_CHANGES_REQUESTS});
		//click change requests
		SeleniumUtil.click(SeleniumUtil.getCachedElement(CTC_LINK_CHANGES_REQUESTS));
		SeleniumUtil.waitForFixedMilliseconds(1000);
	}
	public static void enterChangesQuotes(){
		//login
		SpHomePageUtil.enter();
		//enter contracts\change/renewals page
		SeleniumUtil.waitForFixedMilliseconds(1000);
		SpHomePageUtil.enterContractsChange();
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.waitForFixedMilliseconds(1000);
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{CTC_LINK_QUOTES});
		//click quotes
		SeleniumUtil.click(SeleniumUtil.getCachedElement(CTC_LINK_QUOTES));
		SeleniumUtil.waitForFixedMilliseconds(1000);
	}
	public static void enterChangesRenewals(){
		//login
		SpHomePageUtil.enter();
		//enter contracts\change/renewals page
		SpHomePageUtil.enterContractsChange();
		SeleniumUtil.waitForFixedMilliseconds(1000);
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.waitForFixedMilliseconds(1000);
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{CTC_LINK_RENEWALS});
		//click renewals
		SeleniumUtil.waitForFixedMilliseconds(1000);
		SeleniumUtil.click(SeleniumUtil.getCachedElement(CTC_LINK_RENEWALS));
	}
}
